<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    h1 {
      font-size: 20px;
      color: bisque;
      background: #ccc;
    }

    /* 且运算符 */
    /* 检测到窗口宽度在700px到1000px时应用样式 */
    @media (min-width: 700px) and (max-width: 1000px) {
      h1 {
        background-color: blue;
      }
    }

    @media screen and (min-width: 700px) and (max-width: 1000px) {
      h1 {
        background-color: blue;
      }
    }

    /* 或运算符 */
    /* 检测到窗口宽度小于等于700px或大于等于1000px时应用样式 */
    @media(max-width: 700px), (min-width: 1000px) {
      h1 {
        color: blueviolet;
      }
    }

    @media(max-width: 700px) or (min-width: 1000px) {}

    /* 否定运算符 */
    @media not screen {
      h1 {
        color: chartreuse;
      }
    }

    /* 肯定运算符 */
    @media only screen {
      h1 {
        color: cadetblue;
      }
    }
  </style>
</head>

<body>
  <h1>运算符</h1>
</body>

</html>